/*
ID: khymill1
PROG: kimbits 
LANG: C++
*/
#include <string.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

void dfs(int index, unsigned int cur, int oneCount, int n, int l, vector<unsigned int> &ans)
{
    if (oneCount <= l && index == n) {
        ans.push_back(cur);
        return;
    }
    if (index == n) return;

        if ((cur&(1<<index)) == 0) {
            cur |= 1 << index;
            dfs(index+1, cur, oneCount+1, n, l, ans);
            cur &= ~(1<<index);
        }
            dfs(index+1, cur, oneCount, n, l, ans);
}

int main()
{
    ifstream fin("kimbits.in");
    ofstream fout("kimbits.out");
    int n, l, i;
    fin >> n >> l >> i;
    unsigned int cur = 0;
    unsigned int oneCount = 0;
    vector<unsigned int> ans;
    dfs(0,cur,oneCount,n,l, ans);
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) 
        cout << ans[i] << endl;
    int result = ans[i-1];
    string str;
    while(result > 0) {
        if (result%2) str += '1';
        else str += '0';
        result /=2;
    }
    reverse(str.begin(), str.end());
    cout << str << endl;
    return 0;
}                                          
